
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>佰林の订单详情</title>
    <link rel="stylesheet" href="/common/layui/css/layui.css">
    <link rel="stylesheet" href="/admin/css/style.css">
    <script src="/common/layui/layui.js"></script>
    <script src="/common/jquery-3.3.1.min.js"></script>
    <script src="/common/vue.min.js"></script>
</head>
<body>
<div class="main" id="app">
    <!--        左侧数据-->
    <div id="fixedData">
        <!--顶栏-->
        <header>
            <h1 v-text="webname"></h1>
            <div class="breadcrumb">
                <i class="layui-icon">&#xe715;</i>
                <ul>
                    <li v-for="vo in address">
                        <a  v-text="vo.name" :href="vo.url" ></a> <span>/</span>
                    </li>
                </ul>
            </div>
            <a>预定餐位</a>
        </header>
        <!--左栏-->
        <div class="left">
            <ul class="cl" >
                <!--顶级分类-->
                <li v-for="vo,index in menu" :class="{hidden:vo.hidden}">
                    <a href="javascript:;"  :class="{active:vo.active}"  @click="onActive(index)">
                        <i class="layui-icon" v-html="vo.icon"></i>
                        <span v-text="vo.name"></span>
                        <i class="layui-icon arrow" v-show="vo.url.length==0">&#xe61a;</i> <i v-show="vo.active" class="layui-icon active">&#xe623;</i>
                    </a>
                    <!--子级分类-->
                    <div v-for="vo2,index2 in vo.list">
                        <a href="javascript:;" :class="{active:vo2.active}" @click="onActive(index,index2)" v-text="vo2.name"></a>
                        <i v-show="vo2.active" class="layui-icon active">&#xe623;</i>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <!--右侧-->
    <div class="right" id="Right">
        <div class="layui-row">
            <div  class="layui-col-lg4 layui-col-md-offset8" style="text-align: right">

                <div class="layui-input-inline" style="width: 300px">
                    <input type="text" name="k" value="" placeholder="单号" class="layui-input key">
                </div>
                <button type="button" class="layui-btn sou">搜索</button>
            </div>
        </div>
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th>序号</th>
                <th>商品ID</th>
                <th>商品类型</th>
                <th>商品名字</th>
                <th>商品数量</th>
            </tr>
            </thead>
            <tbody>
            <tr class="id36567" v-for="(item,index) of commodityType" :key="index" >
                <td>{{index+1}}</td>
                <td>{{item.commodityId}}</td>
                <td>{{item.commodityType || '未知'}}</td>
                <td>{{item.commodityName}}</td>
                <td>{{item.commodityNum || 1}}</td>
            </tr>

            </tbody>
        </table>
    </div>
    <script src="/admin/js/config_user.js"></script>
    <script>
        let right = new Vue({
            el:'#Right',
            data: {
                orderList:[],
                commodityType:[],
                status:0,
                activePage:1,
                tableListData:[],//订单数据
            },
            methods:{
                //查看详情
                getDetail(id){
                    let userName = JSON.parse( window.localStorage.getItem('adminInfo') );
                    $.ajax({
                        url:'order/select',
                        type:'post',
                        data:JSON.stringify({
                            id:id,
                        }),
                        contentType: "application/json;charset=UTF-8",
                        success: (data)=> {
                            if(isNotEmpty(data)){
                                this.commodityType=data[0].orderCommodityList
                                this.tableListData = data[0]
                            }else{
                                layui.use('layer', function(){
                                    var layer = layui.layer;
                                    layer.msg('没有数据');
                                });
                            }
                            console.log(data,'data')
                        }
                    })
                },
            },
            mounted(){
                let idList = window.location.search.replace('?','');
                let id = idList.split('&')[0]
                this.getDetail(id)
            },
        })
    </script>
</body>
</html>
